package io.jnet.client.clientchannelcontext;

import java.nio.channels.AsynchronousSocketChannel;
import io.jnet.common.api.ReadHandler;
import io.jnet.common.api.impl.SimpleReadHandler;
import io.jnet.common.bufstorage.BufStorage;
import io.jnet.common.decodec.FrameDecodec;
import io.jnet.common.streamprocessor.StreamProcessor;
import io.jnet.common.util.AioListener;

public class SimpleClientChannelContext extends AbstractClientChannelContext
{
    
    private final ReadHandler readHandler;
    
    public SimpleClientChannelContext(//
            int maxMerge, //
            BufStorage bufStorage, //
            StreamProcessor[] outProcessors, //
            AsynchronousSocketChannel socketChannel, //
            AioListener aioListener, //
            StreamProcessor[] inProcessors, //
            FrameDecodec frameDecodec)
    {
        super(maxMerge, bufStorage, outProcessors, socketChannel, aioListener, inProcessors, frameDecodec);
        readHandler = new SimpleReadHandler(writeHandler, inProcessors, socketChannel, bufStorage, frameDecodec, ioBuf, aioListener, this);
    }
    
    @Override
    public void registerRead()
    {
        readHandler.registerRead();
    }
    
}
